﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="MChatAgent"
	x:Name="Window"
	Title="MChatAgent"
	Width="592" Height="235" AllowsTransparency="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="Manual" WindowStyle="None" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" ShowInTaskbar="True" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Icon="..\Images\mChat.ico" Visibility="Visible" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">

	<Window.Resources>
		<LinearGradientBrush x:Key="ToolbarBGBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF969696" Offset="0"/>
			<GradientStop Color="#FFA6A6A6" Offset="1"/>
		</LinearGradientBrush>
	
		<!-- Brushes : These are used to define the color for background, foreground, selection, enabled etc of all controls
	If you want to change the color of a control you can just chnage the brush; if you want to add a new shape or change arrangement then also edit the template -->
		<LinearGradientBrush x:Key="HoverBrush" EndPoint="1,0.5" StartPoint="0,0.5">
			<GradientStop Color="#FFFFFEE3" Offset="0"/>
			<GradientStop Color="#FFFFE797" Offset="0.26"/>
			<GradientStop Color="#FFFFD734" Offset="0.545"/>
			<GradientStop Color="#FFFFE796" Offset="0.955"/>
		</LinearGradientBrush>
	
		<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#FF646464"/>
		<SolidColorBrush x:Key="DisabledBorderBrush" Color="#FFFFCF74"/>	
		<SolidColorBrush x:Key="SolidBorderBrush" Color="#888"/>
		<!-- Disabled Brushes are used for the Disabled look of each control -->
		<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"/>
	    <Style x:Key="SimpleTabItem" d:IsControlPart="True" TargetType="{x:Type TabItem}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TabItem}">
						<Grid>
							<Border Margin="0,0,-4,0" x:Name="Border" Background="{DynamicResource ToolbarBGBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1,1,1,1">
								<ContentPresenter HorizontalAlignment="Center" Margin="12,2,12,2" x:Name="ContentSite" VerticalAlignment="Center" RecognizesAccessKey="True" ContentSource="Header"/>
							</Border>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="True">
								<Setter Property="Foreground" Value="#FFFFFFFF"/>
								<Setter Property="Panel.ZIndex" Value="100"/>
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
								<Setter Property="BorderThickness" Value="1,1,1,0" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="False">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>		
		</Style>
		<!-- Simple Button - This control sets brushes on each state. Note that these brushes must be listed above since they are static resources -->
		<Style x:Key="HBladeButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="44" Height="50">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Center" Margin="5.958,0,6.958,3.362" VerticalAlignment="Bottom" RecognizesAccessKey="True" Height="13.276"/>
						
							<Image Margin="-8.037,1.001,-9.593,16.999" Source="../Images/document-new1.png" Stretch="None" d:LayoutOverrides="VerticalAlignment"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	
		<!-- Simple Button - This control sets brushes on each state. Note that these brushes must be listed above since they are static resources -->
		<Style x:Key="ConnectButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="Auto">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Stretch" Margin="6.958,34,5.958,-1.6" VerticalAlignment="Stretch" RecognizesAccessKey="True" Height="Auto"/>
						
							<Image Margin="-8.037,1.001,-9.593,16.999" Source="../Images/document-new1.png" Stretch="None" d:LayoutOverrides="VerticalAlignment"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Key="OnGotFocus1"/>
		<Style x:Key="SimpleButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="18.36">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Stretch" Margin="4.958,1,1.958,4.4" VerticalAlignment="Stretch" RecognizesAccessKey="True" Height="Auto" d:LayoutOverrides="VerticalAlignment"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="TabControlClose" TargetType="{x:Type TabControl}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TabControl}">
						<Grid KeyboardNavigation.TabNavigation="Local">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
						
							<TabPanel Grid.Row="0" Margin="0,0,26,0" x:Name="HeaderPanel" Background="Transparent" IsItemsHost="True" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1" Height="21.96" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" RenderTransformOrigin="0.5,0.5">
								<TabPanel.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="0"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</TabPanel.RenderTransform>
							</TabPanel>
						
							<Border Grid.Row="1" x:Name="Border" Background="{DynamicResource ToolbarBGBrush}" BorderBrush="#FFFFCF01" BorderThickness="1" CornerRadius="2" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="2" Margin="0,-4,0,0">
							
								<!-- The implementation switches the content. This control must be named PART_SelectedContentHost -->
								<ContentPresenter Margin="4" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
							
							</Border>
							<Button HorizontalAlignment="Right" Margin="0,1,5,7" Style="{DynamicResource SimpleButton}" VerticalAlignment="Stretch" Width="16.623" Content="X" d:LayoutOverrides="Height" x:Name="CTabButton" Click="CTabButton_Click" Foreground="#FFFFFFFF" BorderThickness="1,1,1,1"/>
						</Grid>					
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="False">
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
						</ControlTemplate.Triggers>
				
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="Foreground" Value="#FFFFFFFF"/>
		</Style>
		<Storyboard x:Key="ServerListShow">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(FrameworkElement.Height)" BeginTime="00:00:00">
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="185"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Style x:Key="AddServ" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="Auto">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Stretch" Margin="6.958,34,5.958,-1.6" VerticalAlignment="Stretch" RecognizesAccessKey="True" Height="Auto"/>
							<Image Margin="21.072,3.461,21.928,19.539" Source="..\Images\document-new.png" Stretch="Fill"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Key="ServerListHide">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(FrameworkElement.Height)" BeginTime="00:00:00">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="185"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="108"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}">
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ScrollViewer}">
						<Grid SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="*"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<DockPanel Margin="{TemplateBinding Padding}">
								<ScrollViewer Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" DockPanel.Dock="Top">
									<GridViewHeaderRowPresenter Margin="2,0,2,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" Columns="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}"/>
								</ScrollViewer>
								<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" KeyboardNavigation.DirectionalNavigation="Local" CanContentScroll="{TemplateBinding CanContentScroll}"/>
							</DockPanel>
							<ScrollBar Cursor="Arrow" x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0.0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							<ScrollBar Cursor="Arrow" x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0.0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							<DockPanel Grid.Column="1" Grid.Row="1" Background="{Binding Path=Background, ElementName=PART_VerticalScrollBar}" LastChildFill="false">
								<Rectangle Width="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Fill="White" DockPanel.Dock="Left"/>
								<Rectangle Height="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Fill="White" DockPanel.Dock="Top"/>
							</DockPanel>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="LeftAligh" TargetType="{x:Type ListView}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="#FF042271"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListView}">
						<Microsoft_Windows_Themes:ListBoxChrome x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding IsMouseOver}">
							<ScrollViewer Padding="{TemplateBinding Padding}" Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Microsoft_Windows_Themes:ListBoxChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
			<VirtualizingStackPanel IsItemsHost="True"/>
		</ItemsPanelTemplate>
		<SolidColorBrush x:Key="FeedMonsterBackground" Color="#FF535353"/>
		<ControlTemplate x:Key="FeedMonsterListViewItem" TargetType="{x:Type ListViewItem}">
			<StackPanel Background="{DynamicResource ToolbarBGBrush}">
				<GridViewRowPresenter Content="{TemplateBinding Content}"
					Columns="{TemplateBinding GridView.ColumnCollection}"/>
			</StackPanel>
		</ControlTemplate>
		<SolidColorBrush x:Key="FeedMonsterBorderBrush" Color="#FFFFCF01"/>
		<Style x:Key="GridViewColumnHeaderGripper"
			TargetType="{x:Type Thumb}">
			<Setter Property="Canvas.Right" Value="-8.5"/>
			<Setter Property="Width" Value="18"/>
			<Setter Property="Height" Value="{Binding Path=ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
			<Setter Property="Padding" Value="0,3,0,4"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Border>
							<Rectangle HorizontalAlignment="Center"
								Width="1"
								Fill="{DynamicResource LightBorderBrush}"/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="myControlTemplateStyle" 
			TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Grid Background="{DynamicResource ToolbarBGBrush}">
							<DockPanel HorizontalAlignment="Center"
								VerticalAlignment="Center">
								<TextBlock Text="{TemplateBinding Content}" 
									FontSize="14" Foreground="{DynamicResource FeedMonsterBorderBrush}"/>
							</DockPanel>
							<Canvas>
								<Thumb x:Name="PART_HeaderGripper"
									Style="{StaticResource GridViewColumnHeaderGripper}"
									Background="Transparent"
                     />
							</Canvas>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<DataTemplate x:Key="myCellTemplateYear">
			<DockPanel>
				<TextBlock Foreground="White" Background="{DynamicResource FeedMonsterBackground}" HorizontalAlignment="Center" Text="{Binding Path=ID}"/>
			</DockPanel>
		</DataTemplate>
		<Style x:Key="LVButt" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="Auto">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Center" Margin="6.958,34,5.958,-1.6" VerticalAlignment="Center" RecognizesAccessKey="True" Height="Auto"/>
							<Image HorizontalAlignment="Stretch" Margin="0,0,-3,23" Width="32" Source="..\Images\edit-paste.png" Stretch="Fill" VerticalAlignment="Stretch"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="OptsButt" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="Auto">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Stretch" Margin="6.958,34,5.958,-1.6" VerticalAlignment="Stretch" RecognizesAccessKey="True" Height="Auto"/>
						
							<Image Margin="-8.037,1.001,-9.593,16.999" Source="..\Images\applications-system.png" Stretch="None" d:LayoutOverrides="VerticalAlignment"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="NormButt" TargetType="{x:Type Button}" BasedOn="{x:Null}">
			<!-- Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/-->
			<Setter Property="Background" Value="#FF535353"/>
			<Setter Property="BorderBrush" Value="#FF535353"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
					
						<!-- We use Grid as a root because it is easy to add more elements to customize the button -->
						<Grid x:Name="Grid" Width="Auto" Height="Auto">
							<Border x:Name="Border" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
						
							<ContentPresenter HorizontalAlignment="Center" Margin="0,3,0,4" VerticalAlignment="Stretch" RecognizesAccessKey="True" Height="Auto" d:LayoutOverrides="Height"/>
						
							<!-- Content Presenter is where the text content etc is placed by the control -->
						</Grid>
					
						<!--Each state sets a brush on the Border in the template -->
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
							
								<!-- Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/-->
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="BorderBrush" Value="#FFFFCF01" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Foreground" Value="#FF000000"/>
								<Setter Property="Background" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource HoverBrush}" TargetName="Border"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
								<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
								<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	
	</Window.Resources>
	<Window.Background>
		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF969696" Offset="0"/>
			<GradientStop Color="#FFA6A6A6" Offset="1"/>
		</LinearGradientBrush>
	
	</Window.Background>

	<Grid x:Name="LayoutRoot">
		<Border Margin="-1,-1,-0.847,0" VerticalAlignment="Top" Height="26.25" CornerRadius="5,4,0,0" BorderBrush="#00505050" BorderThickness="1,1,1,0" x:Name="Titlebar" Visibility="Visible">
			<Border.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FF969696" Offset="1"/>
					<GradientStop Color="#FFC2C2C2" Offset="0"/>
				</LinearGradientBrush>
			</Border.Background>
			<Label Height="Auto" Content="Server List" x:Name="Tblabel" FontStyle="Italic" d:IsStaticText="True" Width="Auto" HorizontalAlignment="Center"/>
		</Border>
		<Image HorizontalAlignment="Right" Margin="0,5,4,0" VerticalAlignment="Top" Width="14" Height="15" Source="../Images/close.png" Stretch="Fill" x:Name="CloseWindow"/>
		<Image HorizontalAlignment="Right" Margin="0,5.5,24,0" VerticalAlignment="Top" Width="14" Height="15" Source="../Images/Minimize.png" Stretch="Fill" x:Name="Min"/>
		<Image HorizontalAlignment="Left" Margin="4,3,0,0" VerticalAlignment="Top" Width="21" Height="21" Source="..\Images\mChat.ico" Stretch="Fill"/>
		<Button Style="{DynamicResource ConnectButton}" Content="Connect" BorderThickness="1,1,1,1" Background="#FF5C5C5D" x:Name="Connect" BorderBrush="#FF525252" FontFamily="Comic Sans MS" Foreground="#FF000000" HorizontalAlignment="Left" Width="56" RenderTransformOrigin="0.5,0.5" Height="55" Margin="4,24.5,0,0" VerticalAlignment="Top" IsEnabled="False" Panel.ZIndex="1" d:LayoutOverrides="VerticalAlignment">
			<Button.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Button.RenderTransform>
		</Button>
		<Button Style="{DynamicResource AddServ}" Content="Add Server" BorderThickness="1,1,1,1" Background="#FF5C5C5D" x:Name="NewServer" BorderBrush="#FF525252" FontFamily="Comic Sans MS" Foreground="#FF000000" HorizontalAlignment="Left" Width="78" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="VerticalAlignment, Height" Height="55" Margin="62,24.5,0,0" VerticalAlignment="Top" IsEnabled="True">
			<Button.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Button.RenderTransform>
		</Button>
		<Border Background="#FFFFFFFF" CornerRadius="4,4,4,4" BorderBrush="{x:Null}" x:Name="border" RenderTransformOrigin="0.5,0.5" Margin="0,39,81.5,0" Height="24" d:LayoutOverrides="VerticalAlignment, Height" VerticalAlignment="Top" Width="192" HorizontalAlignment="Right" Visibility="Visible">
			<Border.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Border.RenderTransform>
			<Border.BitmapEffect>
				<OuterGlowBitmapEffect/>
			</Border.BitmapEffect>
			<Border.BitmapEffectInput>
				<BitmapEffectInput/>
			</Border.BitmapEffectInput>
			<TextBox Width="Auto" Height="22" Text="Join a channel" TextWrapping="Wrap" BorderThickness="0,0,0,0" x:Name="chananme" FontStyle="Italic" Margin="3,0,3,0"/>
		</Border>
		<RichTextBox Width="Auto" x:Name="Console" Margin="3,94,3,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" Height="18.64" VerticalAlignment="Top" Visibility="Hidden">
			<FlowDocument />					
		</RichTextBox>
		<Button Style="{DynamicResource OptsButt}" Content="Options" BorderThickness="1,1,1,1" Background="#FF5C5C5D" x:Name="Options_Copy" BorderBrush="#FF525252" FontFamily="Comic Sans MS" Foreground="#FF000000" RenderTransformOrigin="0.5,0.5" Height="55" Margin="218,24.5,0,0" VerticalAlignment="Top" IsEnabled="True" IsDefault="False" d:LayoutOverrides="VerticalAlignment" Width="60" HorizontalAlignment="Left">
			<Button.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Button.RenderTransform>
		</Button>
		<ListView x:Name="lvservers" IsSynchronizedWithCurrentItem="True" Background="{DynamicResource ToolbarBGBrush}" BorderBrush="{DynamicResource FeedMonsterBorderBrush}" Margin="0,82,0,-1"  RenderTransformOrigin="0.524,0.501" Grid.IsSharedSizeScope="False" Foreground="#FFFFFFFF" ItemsSource="{Binding}">
			<ListView.ItemContainerStyle>
				<Style TargetType="{x:Type ListViewItem}"  >
					<Setter Property="Template"  Value="{StaticResource FeedMonsterListViewItem}"/>
					<Style.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Foreground" Value="{DynamicResource FeedMonsterBorderBrush}" />
							<Setter Property="Cursor" Value="Hand"/>
						</Trigger>
						<Trigger Property="IsSelected" Value="true">
							<Setter Property="Foreground" Value="{DynamicResource FeedMonsterBorderBrush}" />
						</Trigger>
					</Style.Triggers>
				</Style>		
			</ListView.ItemContainerStyle>	
			<ListView.View>
				<GridView ColumnHeaderContainerStyle="{StaticResource myControlTemplateStyle}">
					<GridViewColumn Header="Server" DisplayMemberBinding="{Binding Path=Server}"  Width="294" CellTemplate="{StaticResource myCellTemplateYear}" />
					<GridViewColumn Header="Username"  DisplayMemberBinding="{Binding Path=Username}" Width="214" CellTemplate="{StaticResource myCellTemplateYear}"/>
				</GridView>
			</ListView.View>
		</ListView>
		<Button Style="{DynamicResource LVButt}" Content="Log Viewer" BorderThickness="1,1,1,1" Background="#FF5C5C5D" x:Name="LogBrowser" BorderBrush="#FF525252" FontFamily="Comic Sans MS" Foreground="#FF000000" HorizontalAlignment="Left" Width="74" RenderTransformOrigin="0.5,0.5" Height="55" Margin="142,24,0,0" VerticalAlignment="Top" IsEnabled="True" IsDefault="False">
			<Button.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Button.RenderTransform>
		</Button>
		<Button Style="{DynamicResource NormButt}" Content="About" BorderThickness="1,1,1,1" Background="#FF5C5C5D" x:Name="AboutButton" BorderBrush="#FF535353" FontFamily="Comic Sans MS" Foreground="#FF000000" RenderTransformOrigin="0.433,-0.126" VerticalAlignment="Top" Height="20.948" Margin="0,38.625,8.551,0" Width="52.98" HorizontalAlignment="Right">
			<Button.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="-360.296"/>
					<TranslateTransform X="-0.064" Y="0.021"/>
				</TransformGroup>
			</Button.RenderTransform>
		</Button>
        <Button Height="23" HorizontalAlignment="Right" Margin="0,3,57,0" Name="Button1" VerticalAlignment="Top" Width="75" Visibility="Hidden">Button</Button>
    </Grid>
</Window>